#ifndef _PAGE_INIT_HPP
#define _PAGE_INIT_HPP

void pageInit() {
	LVMT;
	// 主背景
	root = lv_obj_create(lv_scr_act());
	lv_obj_remove_style_all(root);
	lv_obj_set_size(root, CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT);
	lv_obj_set_style_bg_color(root, LV_COLOR_MAIN_BG_2, 0);
	lv_obj_center(root);
	
	// 顶部状态栏
	lv_obj_t *statusBody = lv_obj_create(root);
	lv_obj_remove_style_all(statusBody);
	lv_obj_set_style_bg_color(statusBody, LV_COLOR_MAIN_BG_1, 0);
	lv_obj_set_style_bg_opa(statusBody, LV_OPA_COVER, 0);
	lv_obj_set_size(statusBody, CONFIG_SCREEN_WIDTH, CONFIG_TOP_STATUS_BAR_HEIGHT + 10);

	LVMG;
	statusBarInit(statusBody);
	LVMT;

	// 主体显示区域
	pageMain = lv_obj_create(root);
	lv_obj_remove_style_all(pageMain);
	lv_obj_set_style_bg_color(pageMain, LV_COLOR_MAIN_BG_2, 0);
	lv_obj_set_style_radius(pageMain, 10, 0);
	lv_obj_set_style_bg_opa(pageMain, LV_OPA_COVER, 0);
	lv_obj_set_pos(pageMain, 0, CONFIG_TOP_STATUS_BAR_HEIGHT);
	lv_obj_set_size(pageMain, CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT - CONFIG_TOP_STATUS_BAR_HEIGHT);

	pageInfo = lv_obj_create(pageMain);
	lv_obj_add_flag(pageInfo, LV_OBJ_FLAG_HIDDEN);
	lv_obj_remove_style_all(pageInfo);
	lv_obj_center(pageInfo);
	lv_obj_set_size(pageInfo, CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT - CONFIG_TOP_STATUS_BAR_HEIGHT);
	
	pageHome = lv_obj_create(pageMain);
	lv_obj_add_flag(pageHome, LV_OBJ_FLAG_HIDDEN);
	lv_obj_center(pageHome);
	lv_obj_remove_style_all(pageHome);
	lv_obj_set_size(pageHome, CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT - CONFIG_TOP_STATUS_BAR_HEIGHT);
	
	pageSettings = lv_obj_create(pageMain);
	lv_obj_add_flag(pageSettings, LV_OBJ_FLAG_HIDDEN);
	lv_obj_center(pageSettings);
	lv_obj_remove_style_all(pageSettings);
	lv_obj_set_size(pageSettings, CONFIG_SCREEN_WIDTH, CONFIG_SCREEN_HEIGHT - CONFIG_TOP_STATUS_BAR_HEIGHT);
	
	LVMG;
	uiNoteInit();

	// pageInfoInit();
	// pageHomeInit();
	// pageSettingsInit();

	pages[PAGE_INFO] = (page_t){pageInfo, "pageInfo", false, &pageInfoShowFun};
	pages[PAGE_HOME] = (page_t){pageHome, "pageHome", false, &pageHomeShowFun};
	pages[PAGE_SETTINGS] = (page_t){pageSettings, "pageSettings", false, &pageSettingsShowFun};
	
}
#endif